# 遍历words，取出每个字符串
# 判断当前这个字符串，是否是 s 的前缀就行了
def countPrefixes(words: list, s: str):
    count = 0
    for word in words:
        if s.startswith(word):
            # s 是以word 开头
            count += 1
    return count


print(countPrefixes(['a', 'b', 'c', 'ab', 'bc', 'abc'], 'abc'))
print(countPrefixes(['a', 'a'], 'aa'))
